package com.test.gwt.mvp.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.test.gwt.mvp.client.factory.ClientFactory;

public class MainScreenImpl implements MainScreen {
	private final LayoutPanel mainLayoutPanel;

	interface AppLayoutUiBinder extends UiBinder<LayoutPanel, MainScreenImpl> {
	}

	private static AppLayoutUiBinder binder = GWT
			.create(AppLayoutUiBinder.class);
	@UiField
	SimplePanel maillistPanel;
	@UiField
	SimplePanel maildetailPanel;

	public MainScreenImpl() {
		mainLayoutPanel = binder.createAndBindUi(this);
		mainLayoutPanel.setWidgetTopHeight(maillistPanel, 5, Unit.PCT, 50, Unit.PCT);
		mainLayoutPanel.setWidgetTopHeight(maildetailPanel, 50, Unit.PCT, 50, Unit.PCT);
	}

	@Override
	public LayoutPanel getMainLayoutPanel() {
		return mainLayoutPanel;
	}

	@Override
	public AcceptsOneWidget getMailDetailContainer() {
		return maildetailPanel;
	}

	@Override
	public AcceptsOneWidget getMailListContainer() {
		return maillistPanel;
	}
}